package com.aaa.emp.service;

import com.aaa.common.entity.Book;
import com.aaa.common.entity.Emp;
import com.aaa.emp.dao.EmpDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import java.util.List;

/**
 * @author ：杨
 * @date ：Created in 2020/7/22 14:39
 * @description：
 * @modified By：
 * @version:
 */
@Service
public class EmpServiceImpl implements EmpService{
    @Autowired
    private EmpDao empDao;
    @Autowired
    RestTemplate restTemplate;

    @Override
    public List<Emp> selectEmp() {
        return empDao.selectEmp();
    }

    @Override
    public List<Book> selectBook() {
        return restTemplate.getForObject("http://bookService/book/list",List.class);
    }
}
